package com.lenovo.smarttraffic.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.ResultReceiver;
import android.support.design.widget.TextInputLayout;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;

import com.google.gson.Gson;
import com.lenovo.smarttraffic.InitApp;
import com.lenovo.smarttraffic.R;
import com.lenovo.smarttraffic.api.Login_UserInfoApi;
import com.lenovo.smarttraffic.bean.GsonUserInfoBean;
import com.lenovo.smarttraffic.database.dao.DaoManager;
import com.lenovo.smarttraffic.database.dao.DaoManager_UserInfo;
import com.lenovo.smarttraffic.database.dao.UserInfoBean;
import com.lenovo.smarttraffic.database.dao.UserInfoBeanDao;
import com.lenovo.smarttraffic.ui.fragment.fgBean.JsonBean;
import com.lenovo.smarttraffic.zm.Bean.UserBean;
import com.lenovo.smarttraffic.zm.Network_setActivity;
import com.lenovo.smarttraffic.zm.OkHttpUtils1;

import org.greenrobot.greendao.query.Query;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.lenovo.smarttraffic.MainActivity.tv_UserNameXX;


/**
 * @author Amoly
 * @date 2019/4/11.
 * description：
 */
public class LoginActivity extends BaseActivity implements View.OnClickListener {

    private EditText mEditTextName;
    private EditText mEditTextPassword;
    private TextInputLayout mTextInputLayoutName;
    private TextInputLayout mTextInputLayoutPswd;
    SharedPreferences sharedPreferences;
    public String TAG = "hasdhuhbdas";
    public static String LoginPersonName = "";
    private Button loginButton;
    private UserBean user;
    private CheckBox jzpwdCB;
    private CheckBox autologCB;
    private SharedPreferences.Editor edit;
    private boolean loginFlag;
    private UserInfoBeanDao userInfoBeanDao;


    @Override
    protected int getLayout() {
        return R.layout.activity_login;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initToolBar(findViewById(R.id.toolbar), true, getString(R.string.login));
        sharedPreferences = getSharedPreferences("LoginFlag", Context.MODE_PRIVATE);
        initView();
        if (loginFlag) {
            String account = sharedPreferences.getString("account", "");
            String pwd = sharedPreferences.getString("pwd", "");
            mEditTextName.setText(account);
            mEditTextPassword.setText(pwd);
            jzpwdCB.setChecked(true);
        }
    }

    //网络设置
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.network_setting, menu);
        return true;
    }

    //网络设置跳转
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        super.onOptionsItemSelected(item);
        switch (item.getItemId()) {
            case R.id.action_settings:
                startActivity(new Intent(this, Network_setActivity.class));
                break;
        }
        return true;
    }


    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.loginBtn) {
            hideSoftInput(v);
            if (!checkName(mEditTextName.getText(), true))
                return;
            if (!checkPwd(mEditTextPassword.getText(), true))
                return;
            String username = mEditTextName.getText().toString();
            String userPwd = mEditTextPassword.getText().toString();
            okHttpUtils(username, userPwd);
        }
    }

    private void okHttpUtils(String username, String userPwd) {
        Log.e(TAG, "onClick: " + username + "===" + userPwd);
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("UserName", username);
            jsonObject.put("UserPwd", userPwd);
            Log.e(TAG, "onClick: " + jsonObject.toString());
            OkHttpUtils1.doRequest("http://192.168.1.110:8088/transportservice/action/user_login.do", jsonObject.toString(), new OkHttpUtils1.OnResLis() {
                @Override
                public void success(String result) {
                    // if (result.equals("")) {
                    //判断    null 用==     判断  ""  用equals
                    if (null == result) {
                        Toast.makeText(LoginActivity.this, "登录失败", Toast.LENGTH_SHORT).show();
                        mEditTextName.setText("");
                        mEditTextPassword.setText("");
                        InitApp.isRegister = false;
                    } else {
                        //数据库初始化
                        DaoManager_UserInfo.getmInstance_UserInfo().init(LoginActivity.this);
                        userInfoBeanDao = DaoManager_UserInfo.getmInstance_UserInfo().getDaoSession_UserInfo().getUserInfoBeanDao();


                        Gson gson = new Gson();
                        user = gson.fromJson(result, UserBean.class);
                        Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
                        InitApp.isRegister = true;
                        InitApp.signIn = true;
                        LoginPersonName = mEditTextName.getText().toString();

                        //sp  保存数据
                        if (jzpwdCB.isChecked()) {
                            edit.putString("account", username);
                            edit.putString("pwd", userPwd);
                            edit.putBoolean("LoginFlag", jzpwdCB.isChecked());
                            edit.commit();
                            InitApp.UserName = LoginPersonName;
                        } else {
                            edit.clear();
                            // 会影响之后其他活动的json提交,所以做了下面的处理
                            InitApp.UserName = LoginPersonName;
                            Log.e(TAG, "success: " + InitApp.UserName);
                            edit.commit();
                        }
                        String userRole = user.getUserRole();
                        //用户中心   为一般管理员 时   将请求数据  放入 数据库中
//                        if (userRole.equals("R02")) {
                        //是否为空   为空为true    第一次加载    否则不加载
                        Log.e(TAG, "success: " + userInfoBeanDao.queryBuilder().list().size());
                        boolean equals = userInfoBeanDao.queryBuilder().list().isEmpty();
                        if (equals) {
                            //api不能用      我也不知道为什么api不能用   所以不调用了
                            // RetrofitCarInfo();
                            //因为接口不能用    但是有数据  所以手动加入数据库
                            initLoad();
                            Log.e(TAG, "success: " + userInfoBeanDao.queryBuilder().list().size() + "11111");
                        }

                      /*  有bug
                         在数据库   未写入数据时
                         如果   一开始登陆 的不是管理员
                         而是其他权限用户
                        那么此时数据库为空*/
                        UserInfoBean unique = userInfoBeanDao.queryBuilder().where(UserInfoBeanDao.Properties.Username.eq(LoginPersonName)).list().get(0);
                        tv_UserNameXX.setText("你好，" + unique.getPname());
                        finish();
                    }

                }
            });
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    //该死的api   害的我只能有一些特殊方法   完成数据库的写入
    private void initLoad() {
        userInfoBeanDao.insert(new UserInfoBean(null, "王生安", "370101196101011001", "男", "user1", "13804110001", "1990-05-21 14:19:21", "user1@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张昧谡", "370203196110101010", "男", "user10", "13804110010", "1990-05-30 14:19:21", "user10@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴少晓", "370285198104161100", "男", "user100", "13804110100", "1990-08-28 14:19:21", "user100@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "廖湖花", "370101198205171101", "男", "user101", "13804110101", "1990-08-29 14:19:21", "user101@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "章苑虹", "370102198306181102", "女", "user102", "13804110102", "1990-08-30 14:19:21", "user102@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "汤瑄意", "370103198407191103", "男", "user103", "13804110103", "1990-08-31 14:19:21", "user103@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "曾琼方", "370104198508201104", "男", "user104", "13804110104", "1990-09-01 14:19:21", "user104@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "胡馨真", "370105198609211105", "女", "user105", "13804110105", "1990-09-02 14:19:21", "user105@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "杨邦游", "370112198710221106", "男", "user106", "13804110106", "1990-09-03 14:19:21", "user106@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卫淮玄", "370123198811231107", "男", "user107", "13804110107", "1990-09-04 14:19:21", "user107@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王研建", "370201198912241108", "女", "user108", "13804110108", "1990-09-05 14:19:21", "user108@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "杨镜祯", "370202198101251109", "男", "user109", "13804110109", "1990-09-06 14:19:21", "user109@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "岑弥勳", "370205196211111011", "男", "user11", "13804110011", "1990-05-31 14:19:21", "user11@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "秦龄颢", "370203198202261110", "男", "user110", "13804110110", "1990-09-07 14:19:21", "user110@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "蒲稳雄", "370205198303271111", "女", "user111", "13804110111", "1990-09-08 14:19:21", "user111@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘铎牧", "370211198404281112", "男", "user112", "13804110112", "1990-09-09 14:19:21", "user112@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "元负祎", "370212198505011113", "男", "user113", "13804110113", "1990-09-10 14:19:21", "user113@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈之万", "370213198606021114", "女", "user114", "13804110114", "1990-09-11 14:19:21", "user114@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "李草革", "370214198707031115", "男", "user115", "13804110115", "1990-09-12 14:19:21", "user115@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孔笛渝", "370281198808041116", "男", "user116", "13804110116", "1990-09-13 14:19:21", "user116@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "俞荔洋", "370282198909051117", "女", "user117", "13804110117", "1990-09-14 14:19:21", "user117@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "童好钧", "370283198110061118", "男", "user118", "13804110118", "1990-09-15 14:19:21", "user118@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "苏遥研", "370284198211071119", "男", "user119", "13804110119", "1990-09-16 14:19:21", "user119@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "宁古薄", "370211196312121012", "女", "user12", "13804110012", "1990-06-01 14:19:21", "user12@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "贺炳江", "370285198312081120", "女", "user120", "13804110120", "1990-09-17 14:19:21", "user120@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "任奥亿", "370101198401091121", "男", "user121", "13804110121", "1990-09-18 14:19:21", "user121@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘龙玉", "370102198502101122", "男", "user122", "13804110122", "1990-09-19 14:19:21", "user122@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "韩恋力", "370103198603111123", "女", "user123", "13804110123", "1990-09-20 14:19:21", "user123@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "费廷格", "370104198704121124", "男", "user124", "13804110124", "1990-09-21 14:19:21", "user124@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙　路", "370105198805131125", "男", "user125", "13804110125", "1990-09-22 14:19:21", "user125@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王武勳", "370112198906141126", "女", "user126", "13804110126", "1990-09-23 14:19:21", "user126@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "余蒙飘", "370123198107151127", "男", "user127", "13804110127", "1990-09-24 14:19:21", "user127@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "白飞解", "370201198208161128", "男", "user128", "13804110128", "1990-09-25 14:19:21", "user128@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "盛彤敬", "370202198309171129", "女", "user129", "13804110129", "1990-09-26 14:19:21", "user129@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张祥德", "370212196401131013", "男", "user13", "13804110013", "1990-06-02 14:19:21", "user13@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "童户虎", "370203198410181130", "男", "user130", "13804110130", "1990-09-27 14:19:21", "user130@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "齐木铭", "370205198511191131", "男", "user131", "13804110131", "1990-09-28 14:19:21", "user131@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "姬喜赋", "370211198612201132", "女", "user132", "13804110132", "1990-09-29 14:19:21", "user132@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邹毅资", "370212198701211133", "男", "user133", "13804110133", "1990-09-30 14:19:21", "user133@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "俞　缘", "370213198802221134", "男", "user134", "13804110134", "1990-10-01 14:19:21", "user134@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "姜竟曼", "370214198903231135", "女", "user135", "13804110135", "1990-10-02 14:19:21", "user135@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "符梨伶", "370281198104241136", "男", "user136", "13804110136", "1990-10-03 14:19:21", "user136@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "傅　俊", "370282198205251137", "男", "user137", "13804110137", "1990-10-04 14:19:21", "user137@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙怡毓", "370283198306261138", "女", "user138", "13804110138", "1990-10-05 14:19:21", "user138@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "潘澜巧", "370284198407271139", "男", "user139", "13804110139", "1990-10-06 14:19:21", "user139@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "何颖升", "370213196502141014", "男", "user14", "13804110014", "1990-06-03 14:19:21", "user14@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈茵斓", "370285198508281140", "男", "user140", "13804110140", "1990-10-07 14:19:21", "user140@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙　锦", "370101198609011141", "女", "user141", "13804110141", "1990-10-08 14:19:21", "user141@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卢靠清", "370102198710021142", "男", "user142", "13804110142", "1990-10-09 14:19:21", "user142@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙仁露", "370103198811031143", "男", "user143", "13804110143", "1990-10-10 14:19:21", "user143@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "路园芸", "370104198912041144", "女", "user144", "13804110144", "1990-10-11 14:19:21", "user144@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "符毓好", "370105198101051145", "男", "user145", "13804110145", "1990-10-12 14:19:21", "user145@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "白西清", "370112198202061146", "男", "user146", "13804110146", "1990-10-13 14:19:21", "user146@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "田研青", "370123198303071147", "女", "user147", "13804110147", "1990-10-14 14:19:21", "user147@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "詹生雨", "370201198404081148", "男", "user148", "13804110148", "1990-10-15 14:19:21", "user148@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周小蓉", "370202198505091149", "男", "user149", "13804110149", "1990-10-16 14:19:21", "user149@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈原庚", "370214196603151015", "女", "user15", "13804110015", "1990-06-04 14:19:21", "user15@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "李昇珂", "370203198606101150", "女", "user150", "13804110150", "1990-10-17 14:19:21", "user150@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "龙秀青", "370205198707111151", "男", "user151", "13804110151", "1990-10-18 14:19:21", "user151@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "岑醇燕", "370211198808121152", "男", "user152", "13804110152", "1990-10-19 14:19:21", "user152@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张懂霞", "370212198909131153", "女", "user153", "13804110153", "1990-10-20 14:19:21", "user153@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "成玻枚", "370213198110141154", "男", "user154", "13804110154", "1990-10-21 14:19:21", "user154@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "何弃芳", "370214198211151155", "男", "user155", "13804110155", "1990-10-22 14:19:21", "user155@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "苏龄青", "370281198312161156", "女", "user156", "13804110156", "1990-10-23 14:19:21", "user156@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘量云", "370282198401171157", "男", "user157", "13804110157", "1990-10-24 14:19:21", "user157@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "龚芝方", "370283198502181158", "男", "user158", "13804110158", "1990-10-25 14:19:21", "user158@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "林效春", "370284198603191159", "女", "user159", "13804110159", "1990-10-26 14:19:21", "user159@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "丘约靖", "370281196704161016", "男", "user16", "13804110016", "1990-06-05 14:19:21", "uesr16@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "潘郁斓", "370285198704201160", "男", "user160", "13804110160", "1990-10-27 14:19:21", "uesr160@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "俞伴菲", "370101198805211161", "男", "user161", "13804110161", "1990-10-28 14:19:21", "uesr161@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卓　云", "370102198906221162", "女", "user162", "13804110162", "1990-10-29 14:19:21", "uesr162@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "时匡贞", "370103198107231163", "男", "user163", "13804110163", "1990-10-30 14:19:21", "uesr163@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "于颐嘉", "370104198208241164", "男", "user164", "13804110164", "1990-10-31 14:19:21", "uesr164@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "武婷俐", "370105198309251165", "女", "user165", "13804110165", "1990-11-01 14:19:21", "uesr165@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周席胤", "370112198410261166", "男", "user166", "13804110166", "1990-11-02 14:19:21", "uesr166@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "穆沪昭", "370123198511271167", "男", "user167", "13804110167", "1990-11-03 14:19:21", "uesr167@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "凌敖劲", "370201198612281168", "女", "user168", "13804110168", "1990-11-04 14:19:21", "uesr168@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "简渝航", "370202198701011169", "男", "user169", "13804110169", "1990-11-05 14:19:21", "uesr169@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈启红", "370282196805171017", "男", "user17", "13804110017", "1990-06-06 14:19:21", "user17@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "宁古舟", "370203198802021170", "男", "user170", "13804110170", "1990-11-06 14:19:21", "user170@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "黄　冰", "370205198903031171", "女", "user171", "13804110171", "1990-11-07 14:19:21", "user171@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "鲁乃燊", "370211198104041172", "男", "user172", "13804110172", "1990-11-08 14:19:21", "user172@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王习帅", "370212198205051173", "男", "user173", "13804110173", "1990-11-09 14:19:21", "user173@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "魏古粟", "370213198306061174", "女", "user174", "13804110174", "1990-11-10 14:19:21", "user174@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "何巍珑", "370214198407071175", "男", "user175", "13804110175", "1990-11-11 14:19:21", "user175@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卢棠易", "370281198508081176", "男", "user176", "13804110176", "1990-11-12 14:19:21", "user176@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘皓涪", "370282198609091177", "女", "user177", "13804110177", "1990-11-13 14:19:21", "user177@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "穆懂魁", "370283198710101178", "男", "user178", "13804110178", "1990-11-14 14:19:21", "user178@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "殷　羿", "370284198811111179", "男", "user179", "13804110179", "1990-11-15 14:19:21", "user179@.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴湘意", "370283196906181018", "女", "user18", "13804110018", "1990-06-07 14:19:21", "user18@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "池　传", "370285198912121180", "女", "user180", "13804110180", "1990-11-16 14:19:21", "user180@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "郭闰顾", "370101198101131181", "男", "user181", "13804110181", "1990-11-17 14:19:21", "user181@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘盖光", "370102198202141182", "男", "user182", "13804110182", "1990-11-18 14:19:21", "user182@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张业汜", "370103198303151183", "女", "user183", "13804110183", "1990-11-19 14:19:21", "user183@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张威卫", "370104198404161184", "男", "user184", "13804110184", "1990-11-20 14:19:21", "user184@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘　萌", "370105198505171185", "男", "user185", "13804110185", "1990-11-21 14:19:21", "user185@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "涂致豪", "370112198606181186", "女", "user186", "13804110186", "1990-11-22 14:19:21", "user186@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "江延松", "370123198707191187", "男", "user187", "13804110187", "1990-11-23 14:19:21", "user187@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "戚树昌", "370201198808201188", "男", "user188", "13804110188", "1990-11-24 14:19:21", "user188@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴茗厦", "370202198909211189", "女", "user189", "13804110189", "1990-11-25 14:19:21", "user189@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "宁芹谚", "370284196107191019", "男", "user19", "13804110019", "1990-06-08 14:19:21", "user19@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "叶岳辉", "370203199110221190", "男", "user190", "13804110190", "1990-11-26 14:19:21", "user190@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "易渝界", "370205199211231191", "男", "user191", "13804110191", "1990-11-27 14:19:21", "user191@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "欧仰麦", "370211199312241192", "女", "user192", "13804110192", "1990-11-28 14:19:21", "user192@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "徐吟量", "370212199401251193", "男", "user193", "13804110193", "1990-11-29 14:19:21", "user193@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁律颜", "370213199502261194", "男", "user194", "13804110194", "1990-11-30 14:19:21", "user194@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "李易相", "370214199603271195", "女", "user195", "13804110195", "1990-12-01 14:19:21", "user195@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "贺白枫", "370281199704281196", "男", "user196", "13804110196", "1990-12-02 14:19:21", "user196@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孟鸿更", "370282199805011197", "男", "user197", "13804110197", "1990-12-03 14:19:21", "user197@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张图承", "370283199906021198", "女", "user198", "13804110198", "1990-12-04 14:19:21", "user198@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "廖惜汐", "370284199107031199", "男", "user199", "13804110199", "1990-12-05 14:19:21", "user199@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张顺谷", "370102196202021002", "男", "user2", "13804110002", "1990-05-22 14:19:21", "user2@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邢衷晓", "370285196208201020", "男", "user20", "13804110020", "1990-06-09 14:19:21", "user20@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈招戚", "370285199208041200", "男", "user200", "13804110200", "1990-12-06 14:19:21", "user200@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "方柱昊", "370101199309051201", "女", "user201", "13804110201", "1990-12-07 14:19:21", "user201@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "黄义昼", "370102199410061202", "男", "user202", "13804110202", "1990-12-08 14:19:21", "user202@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张桓甫", "370103199511071203", "男", "user203", "13804110203", "1990-12-09 14:19:21", "user203@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁洋溢", "370104199612081204", "女", "user204", "13804110204", "1990-12-10 14:19:21", "user204@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "何甘念", "370105199701091205", "男", "user205", "13804110205", "1990-12-11 14:19:21", "user205@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "侯敦强", "370112199802101206", "男", "user206", "13804110206", "1990-12-12 14:19:21", "user206@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈裔丰", "370123199903111207", "女", "user207", "13804110207", "1990-12-13 14:19:21", "user207@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邢启杰", "370201199104121208", "男", "user208", "13804110208", "1990-12-14 14:19:21", "user208@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "高恋方", "370202199205131209", "男", "user209", "13804110209", "1990-12-15 14:19:21", "user209@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "葛冠媛", "370101196309211021", "女", "user21", "13804110021", "1990-06-10 14:19:21", "user21@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王茁珐", "370203199306141210", "女", "user210", "13804110210", "1990-12-16 14:19:21", "user210@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "姬中岩", "370205199407151211", "男", "user211", "13804110211", "1990-12-17 14:19:21", "user211@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴　樵", "370211199508161212", "男", "user212", "13804110212", "1990-12-18 14:19:21", "user212@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "杨杜昼", "370212199609171213", "女", "user213", "13804110213", "1990-12-19 14:19:21", "user213@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "廉凌刚", "370213199710181214", "男", "user214", "13804110214", "1990-12-20 14:19:21", "user214@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王睦羽", "370214199811191215", "男", "user215", "13804110215", "1990-12-21 14:19:21", "user215@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘岩丘", "370281199912201216", "女", "user216", "13804110216", "1990-12-22 14:19:21", "user216@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卫斯晾", "370282199101211217", "男", "user217", "13804110217", "1990-12-23 14:19:21", "user217@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "汤赫禧", "370283199202221218", "男", "user218", "13804110218", "1990-12-24 14:19:21", "user218@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "萧登水", "370284199303231219", "女", "user219", "13804110219", "1990-12-25 14:19:21", "user219@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "钟艳梦", "370102196410221022", "男", "user22", "13804110022", "1990-06-11 14:19:21", "user22@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "骆其节", "370285199404241220", "男", "user220", "13804110220", "1990-12-26 14:19:21", "user220@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "符伯峪", "370101199505251221", "男", "user221", "13804110221", "1990-12-27 14:19:21", "user221@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "甘蔼宾", "370102199606261222", "女", "user222", "13804110222", "1990-12-28 14:19:21", "user222@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卓侨汉", "370103199707271223", "男", "user223", "13804110223", "1990-12-29 14:19:21", "user223@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "乐侨珂", "370104199808281224", "男", "user224", "13804110224", "1990-12-30 14:19:21", "user224@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "倪山骋", "370105199909011225", "女", "user225", "13804110225", "1990-12-31 14:19:21", "user225@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张览秀", "370112199110021226", "男", "user226", "13804110226", "1991-01-01 14:19:21", "user226@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘丰标", "370123199211031227", "男", "user227", "13804110227", "1991-01-02 14:19:21", "user227@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "岳臻俊", "370201199312041228", "女", "user228", "13804110228", "1991-01-03 14:19:21", "user228@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "费　学", "370202199401051229", "男", "user229", "13804110229", "1991-01-04 14:19:21", "user229@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "戚湘玉", "370103196511231023", "男", "user23", "13804110023", "1990-06-12 14:19:21", "user23@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "史岩超", "370203199502061230", "男", "user230", "13804110230", "1991-01-05 14:19:21", "user230@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王慕涛", "370205199603071231", "女", "user231", "13804110231", "1991-01-06 14:19:21", "user231@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陶天瑛", "370211199704081232", "男", "user232", "13804110232", "1991-01-07 14:19:21", "user232@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张彪其", "370212199805091233", "男", "user233", "13804110233", "1991-01-08 14:19:21", "user233@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "易静帜", "370213199906101234", "女", "user234", "13804110234", "1991-01-09 14:19:21", "user234@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "侯革汜", "370214199107111235", "男", "user235", "13804110235", "1991-01-10 14:19:21", "user235@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈牧容", "370281199208121236", "男", "user236", "13804110236", "1991-01-11 14:19:21", "user236@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙渐巍", "370282199309131237", "女", "user237", "13804110237", "1991-01-12 14:19:21", "user237@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴阐琮", "370283199410141238", "男", "user238", "13804110238", "1991-01-13 14:19:21", "user238@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "柳长翊", "370284199511151239", "男", "user239", "13804110239", "1991-01-14 14:19:21", "user239@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "丁慧湘", "370104196612241024", "女", "user24", "13804110024", "1990-06-13 14:19:21", "user24@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "许席哲", "370285199612161240", "女", "user240", "13804110240", "1991-01-15 14:19:21", "user240@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张桦伦", "370101199701171241", "男", "user241", "13804110241", "1991-01-16 14:19:21", "user241@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "区绪声", "370102199802181242", "男", "user242", "13804110242", "1991-01-17 14:19:21", "user242@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁三贡", "370103199903191243", "女", "user243", "13804110243", "1991-01-18 14:19:21", "user243@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "戚阐瑞", "370104199504201244", "男", "user244", "13804110244", "1991-01-19 14:19:21", "user244@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "姬融致", "370105199605211245", "男", "user245", "13804110245", "1991-01-20 14:19:21", "user245@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "虞竞徽", "370112199706221246", "女", "user246", "13804110246", "1991-01-21 14:19:21", "user246@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邬辉聪", "370123199807231247", "男", "user247", "13804110247", "1991-01-22 14:19:21", "user247@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "赵营笛", "370201199908241248", "男", "user248", "13804110248", "1991-01-23 14:19:21", "user248@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "施　丹", "370202199109251249", "女", "user249", "13804110249", "1991-01-24 14:19:21", "user249@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈蕊筌", "370105196701251025", "男", "user25", "13804110025", "1990-06-14 14:19:21", "user25@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "史闰煦", "370203199210261250", "男", "user250", "13804110250", "1991-01-25 14:19:21", "user250@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "彭坚杰", "370205199311271251", "男", "user251", "13804110251", "1991-01-26 14:19:21", "user251@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙牡江", "370211199412281252", "女", "user252", "13804110252", "1991-01-27 14:19:21", "user252@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "章跋仆", "370212199501011253", "男", "user253", "13804110253", "1991-01-28 14:19:21", "user253@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "雷池艾", "370213199602021254", "男", "user254", "13804110254", "1991-01-29 14:19:21", "user254@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "章付如", "370214199703031255", "女", "user255", "13804110255", "1991-01-30 14:19:21", "user255@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "康翼凤", "370281199804041256", "男", "user256", "13804110256", "1991-01-31 14:19:21", "user256@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙千诗", "370282199905051257", "男", "user257", "13804110257", "1991-02-01 14:19:21", "user257@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "简岚巍", "370283199106061258", "女", "user258", "13804110258", "1991-02-02 14:19:21", "user258@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王思靖", "370284199207071259", "男", "user259", "13804110259", "1991-02-03 14:19:21", "user259@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王赞群", "370112196802261026", "男", "user26", "13804110026", "1990-06-15 14:19:21", "user26@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈　万", "370285199308081260", "男", "user260", "13804110260", "1991-02-04 14:19:21", "user260@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "欧之云", "370101199409091261", "女", "user261", "13804110261", "1991-02-05 14:19:21", "user261@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "金奉娟", "370102199510101262", "男", "user262", "13804110262", "1991-02-06 14:19:21", "user262@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙珊荃", "370103199611111263", "男", "user263", "13804110263", "1991-02-07 14:19:21", "user263@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周俏虹", "370104199712121264", "女", "user264", "13804110264", "1991-02-08 14:19:21", "user264@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张待蕊", "370105199801131265", "男", "user265", "13804110265", "1991-02-09 14:19:21", "user265@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "蒲脉童", "370112199902141266", "男", "user266", "13804110266", "1991-02-10 14:19:21", "user266@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梅牧鹃", "370123199503151267", "女", "user267", "13804110267", "1991-02-11 14:19:21", "user267@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陶搏晗", "370201199604161268", "男", "user268", "13804110268", "1991-02-12 14:19:21", "user268@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卫简暖", "370202199705171269", "男", "user269", "13804110269", "1991-02-13 14:19:21", "user269@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈图凤", "370123196903271027", "女", "user27", "13804110027", "1990-06-16 14:19:21", "user27@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙喜韵", "370203199806181270", "女", "user270", "13804110270", "1991-02-14 14:19:21", "user270@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "关结荃", "370205199907191271", "男", "user271", "13804110271", "1991-02-15 14:19:21", "user271@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "廉篱翠", "370211199108201272", "男", "user272", "13804110272", "1991-02-16 14:19:21", "user272@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "危娰筱", "370212199209211273", "女", "user273", "13804110273", "1991-02-17 14:19:21", "user273@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "钟帅芸", "370213199310221274", "男", "user274", "13804110274", "1991-02-18 14:19:21", "user274@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "徐　银", "370214199411231275", "男", "user275", "13804110275", "1991-02-19 14:19:21", "user275@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁珑诺", "370281199512241276", "女", "user276", "13804110276", "1991-02-20 14:19:21", "user276@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孔嫡妍", "370282199601251277", "男", "user277", "13804110277", "1991-02-21 14:19:21", "user277@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "甘廷阳", "370283199702261278", "男", "user278", "13804110278", "1991-02-22 14:19:21", "user278@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "雷蕾真", "370284199803271279", "女", "user279", "13804110279", "1991-02-23 14:19:21", "user279@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "毕柯音", "370201196104281028", "男", "user28", "13804110028", "1990-06-17 14:19:21", "user28@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "韩宇窍", "370285199904281280", "男", "user280", "13804110280", "1991-02-24 14:19:21", "user280@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邹树园", "370101199105011281", "男", "user281", "13804110281", "1991-02-25 14:19:21", "user281@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周戚晴", "370102199206021282", "女", "user282", "13804110282", "1991-02-26 14:19:21", "user282@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陆凛娣", "370103199307031283", "男", "user283", "13804110283", "1991-02-27 14:19:21", "user283@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙静芙", "370104199408041284", "男", "user284", "13804110284", "1991-02-28 14:19:21", "user284@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "涂俱珍", "370105199509051285", "女", "user285", "13804110285", "1991-03-01 14:19:21", "user285@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张察妙", "370202196205011029", "男", "user29", "13804110029", "1990-06-18 14:19:21", "user29@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张淮森", "370103196303031003", "女", "user3", "13804110003", "1990-05-23 14:19:21", "user3@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "郑迎凌", "370203196306021030", "女", "user30", "13804110030", "1990-06-19 14:19:21", "user30@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "文儒御", "370205196407031031", "男", "user31", "13804110031", "1990-06-20 14:19:21", "user31@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卢辅岳", "370211196508041032", "男", "user32", "13804110032", "1990-06-21 14:19:21", "user32@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "岳珂秩", "370212196609051033", "女", "user33", "13804110033", "1990-06-22 14:19:21", "user33@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "于偌朔", "370213196710061034", "男", "user34", "13804110034", "1990-06-23 14:19:21", "user34@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "倪景民", "370214196811071035", "男", "user35", "13804110035", "1990-06-24 14:19:21", "user35@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "李丞佩", "370281196912081036", "女", "user36", "13804110036", "1990-06-25 14:19:21", "user36@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "褚郁安", "370282196101091037", "男", "user37", "13804110037", "1990-06-26 14:19:21", "user37@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "韦显敬", "370283196202101038", "男", "user38", "13804110038", "1990-06-27 14:19:21", "user38@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周丹淦", "370284196303111039", "女", "user39", "13804110039", "1990-06-28 14:19:21", "user39@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周逸依", "370104196404041004", "男", "user4", "13804110004", "1990-05-24 14:19:21", "user4@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "龙乔盼", "370285196404121040", "男", "user40", "13804110040", "1990-06-29 14:19:21", "user40@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁　舒", "370101196505131041", "男", "user41", "13804110041", "1990-06-30 14:19:21", "user41@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "岑修聪", "370102196606141042", "女", "user42", "13804110042", "1990-07-01 14:19:21", "user42@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "文　法", "370103196707151043", "男", "user43", "13804110043", "1990-07-02 14:19:21", "user43@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "余雄锡", "370104196808161044", "男", "user44", "13804110044", "1990-07-03 14:19:21", "user44@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "刘胜汉", "370105196909171045", "女", "user45", "13804110045", "1990-07-04 14:19:21", "user45@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈颁谊", "370112197110181046", "男", "user46", "13804110046", "1990-07-05 14:19:21", "user46@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "蔡德俊", "370123197211191047", "男", "user47", "13804110047", "1990-07-06 14:19:21", "user47@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "侯杏彩", "370201197312201048", "女", "user48", "13804110048", "1990-07-07 14:19:21", "user48@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陶益怡", "370202197401211049", "男", "user49", "13804110049", "1990-07-08 14:19:21", "user49@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "朱付流", "370105196505051005", "男", "user5", "13804110005", "1990-05-25 14:19:21", "user5@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁频淼", "370203197502221050", "男", "user50", "13804110050", "1990-07-09 14:19:21", "user50@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "罗融雪", "370205197603231051", "女", "user51", "13804110051", "1990-07-10 14:19:21", "user51@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "钱里桦", "370211197704241052", "男", "user52", "13804110052", "1990-07-11 14:19:21", "user52@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张晶卿", "370212197805251053", "男", "user53", "13804110053", "1990-07-12 14:19:21", "user53@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "欧房楠", "370213197906261054", "女", "user54", "13804110054", "1990-07-13 14:19:21", "user54@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁仓蓉", "370214197107271055", "男", "user55", "13804110055", "1990-07-14 14:19:21", "user55@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴影雯", "370281197208281056", "男", "user56", "13804110056", "1990-07-15 14:19:21", "user56@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "杨才芝", "370282197309011057", "女", "user57", "13804110057", "1990-07-16 14:19:21", "user57@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "沈传喜", "370283197410021058", "男", "user58", "13804110058", "1990-07-17 14:19:21", "user58@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "吴音同", "370284197511031059", "男", "user59", "13804110059", "1990-07-18 14:19:21", "user59@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "李彩早", "370112196606061006", "女", "user6", "13804110006", "1990-05-26 14:19:21", "user6@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "张悟玫", "370285197612041060", "女", "user60", "13804110060", "1990-07-19 14:19:21", "user60@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王顺坤", "370101197701051061", "男", "user61", "13804110061", "1990-07-20 14:19:21", "user61@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王均染", "370102197802061062", "男", "user62", "13804110062", "1990-07-21 14:19:21", "user62@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "齐榜卫", "370103197903071063", "女", "user63", "13804110063", "1990-07-22 14:19:21", "user63@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周　启", "370104197104081064", "男", "user64", "13804110064", "1990-07-23 14:19:21", "user64@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "蔡季雄", "370105197205091065", "男", "user65", "13804110065", "1990-07-24 14:19:21", "user65@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "沈光岸", "370112197306101066", "女", "user66", "13804110066", "1990-07-25 14:19:21", "user66@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "卫颁细", "370123197407111067", "男", "user67", "13804110067", "1990-07-26 14:19:21", "user67@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "石　厚", "370201197508121068", "男", "user68", "13804110068", "1990-07-27 14:19:21", "user68@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "章晞旺", "370202197609131069", "女", "user69", "13804110069", "1990-07-28 14:19:21", "user69@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "梁澄静", "370123196707071007", "男", "user7", "13804110007", "1990-05-27 14:19:21", "user7@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈孝厦", "370203197710141070", "男", "user70", "13804110070", "1990-07-29 14:19:21", "user70@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "雷础炯", "370205197811151071", "男", "user71", "13804110071", "1990-07-30 14:19:21", "user71@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "区胄法", "370211197912161072", "女", "user72", "13804110072", "1990-07-31 14:19:21", "user72@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "柳霖席", "370212197101171073", "男", "user73", "13804110073", "1990-08-01 14:19:21", "user73@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "颜便贤", "370213197202181074", "男", "user74", "13804110074", "1990-08-02 14:19:21", "user74@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "辛觅宝", "370214197303191075", "女", "user75", "13804110075", "1990-08-03 14:19:21", "user75@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陶　政", "370281197404201076", "男", "user76", "13804110076", "1990-08-04 14:19:21", "user76@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "廉璨升", "370282197505211077", "男", "user77", "13804110077", "1990-08-05 14:19:21", "user77@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "邱伴斌", "370283197606221078", "女", "user78", "13804110078", "1990-08-06 14:19:21", "user78@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "王觉飘", "370284197707231079", "男", "user79", "13804110079", "1990-08-07 14:19:21", "user79@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "池慕营", "370201196808081008", "男", "user8", "13804110008", "1990-05-28 14:19:21", "user8@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "蔡和智", "370285197808241080", "男", "user80", "13804110080", "1990-08-08 14:19:21", "user80@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "林锐耀", "370101197909251081", "女", "user81", "13804110081", "1990-08-09 14:19:21", "user81@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "施其钱", "370102197110261082", "男", "user82", "13804110082", "1990-08-10 14:19:21", "user82@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "于焯胥", "370103197211271083", "男", "user83", "13804110083", "1990-08-11 14:19:21", "user83@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "温胄昀", "370104197312281084", "女", "user84", "13804110084", "1990-08-12 14:19:21", "user84@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "陈鲜毅", "370105197401011085", "男", "user85", "13804110085", "1990-08-13 14:19:21", "user85@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "林匡容", "370112197502021086", "男", "user86", "13804110086", "1990-08-14 14:19:21", "user86@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "周　臣", "370123197603031087", "女", "user87", "13804110087", "1990-08-15 14:19:21", "user87@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "戚谆桂", "370201197704041088", "男", "user88", "13804110088", "1990-08-16 14:19:21", "user88@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "章仲栾", "370202197805051089", "男", "user89", "13804110089", "1990-08-17 14:19:21", "user89@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "俞灶迟", "370202196909091009", "女", "user9", "13804110009", "1990-05-29 14:19:21", "user9@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "朱鸥隐", "370203197906061090", "女", "user90", "13804110090", "1990-08-18 14:19:21", "user90@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "孙如香", "370205198107071091", "男", "user91", "13804110091", "1990-08-19 14:19:21", "user91@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "沈颜碧", "370211198208081092", "男", "user92", "13804110092", "1990-08-20 14:19:21", "user92@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "华娟女", "370212198309091093", "女", "user93", "13804110093", "1990-08-21 14:19:21", "user93@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "翁昀齐", "370213198410101094", "男", "user94", "13804110094", "1990-08-22 14:19:21", "user94@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "涂邦香", "370214198511111095", "男", "user95", "13804110095", "1990-08-23 14:19:21", "user95@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "谢巾贞", "370281198612121096", "女", "user96", "13804110096", "1990-08-24 14:19:21", "user96@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "黎益欣", "370282198701131097", "男", "user97", "13804110097", "1990-08-25 14:19:21", "user97@qq.com"));
        userInfoBeanDao.insert(new UserInfoBean(null, "莫桦谊", "370283198802141098", "男", "user98", "13804110098", "1990-08-26 14:19:21", "user98@qq.com"));
    }


    private void RetrofitCarInfo() {


        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("http://192.168.1.110:8088/transportservice/action/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        Login_UserInfoApi userInfoApi = retrofit.create(Login_UserInfoApi.class);
        Call<GsonUserInfoBean> call = userInfoApi.getCall(new JsonBean("user1"));
        call.enqueue(new Callback<GsonUserInfoBean>() {
            @Override
            public void onResponse(Call<GsonUserInfoBean> call, Response<GsonUserInfoBean> response) {
                List<GsonUserInfoBean.ROWSDETAILBean> rowsdetailBeans = response.body().getROWS_DETAIL();
                for (int i = 0; i < rowsdetailBeans.size(); i++) {
                    userInfoBeanDao.insert(new UserInfoBean(null, rowsdetailBeans.get(i).getPname(), rowsdetailBeans.get(i).getPcardid(), rowsdetailBeans.get(i).getPsex(), rowsdetailBeans.get(i).getUsername(), rowsdetailBeans.get(i).getPtel(), rowsdetailBeans.get(i).getPregistdate(), rowsdetailBeans.get(i).getUsername()));
                }
            }

            @Override
            public void onFailure(Call<GsonUserInfoBean> call, Throwable t) {
            }
        });
    }

    private boolean checkPwd(CharSequence pswd, boolean isLogin) {
        if (TextUtils.isEmpty(pswd)) {
            if (isLogin) {
                mTextInputLayoutPswd.setError(getString(R.string.error_pwd_empty));
                return false;
            }
        } else {
            mTextInputLayoutPswd.setError(null);
        }
        return true;
    }

    private boolean checkName(CharSequence name, boolean isLogin) {
        if (TextUtils.isEmpty(name)) {
            if (isLogin) {
                mTextInputLayoutName.setError(getString(R.string.error_login_empty));
                return false;
            }
        } else {
            mTextInputLayoutName.setError(null);
        }
        return true;
    }


    /**
     * 隐藏键盘输入法
     *
     * @param view The view.
     */
    public static void hideSoftInput(final View view) {
        InputMethodManager imm =
                (InputMethodManager) InitApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm == null) return;
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0, new ResultReceiver(new Handler()) {
            @Override
            protected void onReceiveResult(int resultCode, Bundle resultData) {
                if (resultCode == InputMethodManager.RESULT_UNCHANGED_SHOWN
                        || resultCode == InputMethodManager.RESULT_SHOWN) {
                    toggleSoftInput();
                }
            }
        });
    }

    /**
     * 软键盘切换
     */
    public static void toggleSoftInput() {
        InputMethodManager imm =
                (InputMethodManager) InitApp.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE);
        //noinspection ConstantConditions
        imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    }

    private void initView() {
        mTextInputLayoutName = findViewById(R.id.textInputLayoutName);
        mTextInputLayoutPswd = findViewById(R.id.textInputLayoutPassword);
        mTextInputLayoutName.setErrorEnabled(true);
        mTextInputLayoutPswd.setErrorEnabled(true);

        loginButton = findViewById(R.id.loginBtn);
        loginButton.setOnClickListener(this);

        mEditTextName = findViewById(R.id.editTextName);
        mEditTextPassword = findViewById(R.id.editTextPassword);
        mEditTextName.addTextChangedListener(new TextWatcher() {
            @Override/*内容要改变之前调用*/
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                /*从start位置开始，count个字符（空字符是0）将被after个字符替换*/

            }

            @Override/*内容要改变时调用*/
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                /*说明在s字符串中，从start位置开始的count个字符刚刚取代了长度为before的旧文本*/
            }

            @Override/*内容要改变之后调用*/
            public void afterTextChanged(Editable s) {
                //这个方法被调用，那么说明s字符串的某个地方已经被改变。
                checkName(s.toString(), false);
            }
        });
        mEditTextPassword.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                checkPwd(s.toString(), false);
            }
        });

        jzpwdCB = (CheckBox) findViewById(R.id.jzpwdCB);
        autologCB = (CheckBox) findViewById(R.id.autologCB);
        edit = sharedPreferences.edit();
        loginFlag = sharedPreferences.getBoolean("LoginFlag", false);

    }
}
